#include <iostream>
#include <cstdio>

using namespace std;

int main(void)
{
    int i;
    int *n = new int; // 堆空间开辟，等效于 malloc
    int *arr = new int[10];

    *n = 13;
    cout << "n = " << *n << endl;

    for (i = 0; i < 10; i++)
        arr[i] = i + 1;

    for (i = 0; i < 10; i++)
        cout << arr[i] << " ";

    cout << endl;

    delete n; // 释放堆空间
    delete[] arr;

    return 0;
}
